<?php if (!defined('THINK_PATH')) exit();?><!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/Admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/skin/green/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/Admin/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="/Public/css/common.css" />
<!--[if IE 6]>
<script type="text/javascript" src="/Public/Admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>修改密码</title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<style>
  .input-text{
    width: 300px;
  }
</style>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 系统管理 
	<span class="c-gray en">&gt;</span> 修改密码 
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" onsubmit="return false;" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>总管理账号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="<?php echo ($_SESSION['username']); ?>" readonly style="border:none;" id="name" name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>旧密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" placeholder="请输入旧密码" id="oldpwd" name="oldpwd">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>新密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" placeholder="输入新密码" id="newpwd" name="password">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input type="hidden" name="id" value="<<?php echo ($info['id']); ?>>">
				<input class="btn btn-primary radius" type="submit" onclick="saveData()" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/Public/Admin/static/h-ui.admin/js/H-ui.admin.js"></script> 
<script type="text/javascript" src="/Public/Admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 

<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.data.js"></script> -->
<!-- <script type="text/javascript" src="/Public/Admin/lib/picker/distpicker.js"></script> -->


<script type="text/javascript" src="/Public/js/common.js"></script>
<script type="text/javascript" src="/Public/js/md5.js"></script>

<!--/_footer 作为公共模版分离出去-->
<script type="text/javascript">
function saveData()
{
	var _load;
	var oldpwd = $.md5($("#oldpwd").val()).toUpperCase();
	var password = $.md5($("#newpwd").val()).toUpperCase();

	if(oldpwd == "" || password == "")
	{
		layer.alert("输入密码！",{icon:2});
		return;
	}

	if(oldpwd == password)
	{
		layer.alert("新密码不能与上一次密码相同！",{icon:2});
		return;	
	}

	$.ajax({
		url:"/admin/system/editPwd",
		data:{oldpwd:oldpwd,password:password},
		type:'post',
		beforeSend:function(){
			_load = layer.load(1);
		},
		success:function(res) {
          	var data = JSON.parse(res);
          	if(data.status == 0)
          	{
	            layer.msg(data.message,{
	              	icon:1,
            		time:2000
	            },function(){
	            	location.reload();
	            })
          	}else{
            	layer.alert(data.message,{
	              	icon:2,
	            })
          	}
        },
        error:function(){
        	layer.msg('网络错误，请稍后重试',{icon:2});
        },
        complete:function(){
        	layer.close(_load);
        }
	});
}
// $(function(){	
// 	$("#form-member-add").validate({
// 		rules:{
// 			name:{
// 				required:true,
// 				minlength:2,
// 				maxlength:16
// 			},
// 			oldpwd:{
// 				required:true,
// 			},
// 			password:{
// 				required:true,
// 				minlength:6,
// 				maxlength:20
// 			},
// 		},
// 		onkeyup:false,
// 		focusCleanup:true,
// 		success:"valid",
// 		submitHandler:function(form){
// 			$(form).ajaxSubmit({
// 		        success:function(res) {
// 		          	var data = JSON.parse(res);
// 		          	if(data.status == 1)
// 		          	{
// 			            layer.msg(data.message,{
// 			              	icon:1,
// 		            		time:2000
// 			            },function(){
// 			            	location.reload();
// 			            })
// 		          	}else{
// 		            	layer.msg(data.message,{
// 			              	icon:2,
// 			              	time:2000
// 			            })
// 		          	}
// 		        },
// 		        error:function(){
// 		        	layer.msg('网络错误，请稍后重试',{icon:2});
// 		        }
// 		    });
// 		}
// 	});
// });
</script> 

</body>
</html>